<template>
  <div>
      <template><headpage></headpage></template>
      <div style="width:100%;padding-top:60px;"></div>
      <div class="myinfo-table" v-if="uinfo">
          <table>
              <tr>
                  <td>UID：</td><td>{{uinfo.uid}}</td>
              </tr>
              <tr>
                  <td>用户名：</td><td>{{uinfo.name}}</td>
              </tr>
              <tr>
                  <td>邮箱：</td><td>{{uinfo.mail}}</td>
              </tr>
              <tr>
                  <td>个性签名：</td><td>{{uinfo.signature}}</td>
              </tr>
              <tr>
                  <td>联系方式：</td><td>{{uinfo.contact}}</td>
              </tr>
              <tr>
                  <td>注册时间：</td><td>{{uinfo.regtime}}</td>
              </tr>
              <tr>
                  <td>查看：</td><td></td>
              </tr>
              <tr>
                  <td>更改：</td><td></td>
              </tr>
              <tr>
                  <td>绑定：</td><td></td>
              </tr>
          </table>
      </div>
  </div>
</template>

<script>
import Head from './childPage/Head'
export default {
    components: {
        headpage:Head
    },
  data () {
      return {
        uinfo:null//当前登录人信息
      }
  },
  created:function () {
      this.InitData();
  },
  methods:{
      //初始化信息
      InitData:function(){
          let self = this;
          if(!g.sid){
              self.$lay.toast('你还没有登录或sid已经失效！', 2000);
              setTimeout(function(){
                  self.$router.push({
                     path:'/'
                  });
              }, 2000);
              return false;
          }
          self.$lay.loading(1,0);
          self.$http.get('q.php/'+g.sid+'/user.index.json?_origin=*').then(function(res){
              if(res.status == 200){
                  console.log(res.data);
                  self.$lay.loading(-1);
                  let data = res.data;
                  self.uinfo = data;
              }
          })
      },
      //跳转到帖子
      JumpPostContent: function(item){
          console.log(this);
          this.$router.push({
              path: '/post/'+item.topic_id,
              query:{
                  title:item.title
              }
          });
      }
  }
}
</script>
<style scoped>
</style>
